import request from '@/utils/request'

// 菜单权限列表
export const jurisdictionListApi = () => request.get('rule/1')

// 增加菜单权限
interface jurisdiction{
    rule_id:number,
    menu : number,
    name : string,
    condition : string,
    method : string ,
    status : number,
    order : number,
    icon : string,
    frontpath : string
}
export const addJurisdictionApi = (jurisdiction:jurisdiction) => request.post(`rule`,{...jurisdiction})

// 修改菜单权限
export const updataJurisdictionApi = (data:jurisdiction) => request.post(`rule/193`,{...data})

// 删除菜单权限
export const removeJurisdictionApi = (id: number) => request.post(`rule/${id}/delete`)

// 修改菜单权限状态
export const updataJurisdictionStateApi = (id:number,status:number) => request.post(`rule/${id}/update_status`,{status})